<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        * {
            margin: 0px;
            padding: 0px;
        }

        .clearfix:after {
            display: table;
            clear: both;
            content: "";
        }

        .fl {
            float: left;
        }

        .shuoshuodiv {
            border-top: 1px solid #ccc;
            border-left: 1px solid #ccc;
            border-right: 1px solid #ccc;

            width: 700px;
            margin: 50px;
            position: relative;
            box-sizing: border-box;
        }

        .shuoshuo_content {
            overflow-y:auto;
            width: 600px;
            height: 60px;
            background: transparent;
            outline: none;
            padding: 3px 6px;
            box-sizing: border-box;

        }

        .qqbg {
            width: 49px;
            height: 60px;
            box-sizing: border-box;
            border-left: 1px solid #ccc;
            position: relative;
            background: #fafafa;
        }

        .qqbg span {
            width: 24px;
            height: 24px;
            display: block;
            position: absolute;
            left: 13px;
            top: 18px;
        }

        .menu .qqbg span {
            top: 10px;
        }

        .menu .qqbg p {
            position: absolute;
            left: 13px;
            top: 38px;
            font-size: 12px;
            color: #777;
        }

        .local span {
            background: url(35.32-yoo170330110550.png) -302px -26px;
        }

        .ablum span {
            background: url(35.32-yoo170330110550.png) -302px -26px;
        }

        .screenshot span {
            background: url(35.32-yoo170330110550.png) -302px -26px;
        }

        .shuoshuo_audio_video > span {
            background: url(35.32-yoo170330110550.png) -250px -234px;
        }

        .shuoshuo_photo > span {
            background: url(35.32-yoo170330110550.png) -250px -182px;
        }

        .shuoshuodiv > span {
            color: #ccc;
            position: absolute;
            left: 6px;
            top: 3px;
            font-size: 14px;
        }

        .whitebg {
            background: white;
        }

        .photo_menu {
            position: absolute;
            top: 60px;
            right: -50px;
            border-right: 1px solid #ccc;
            border-bottom: 1px solid #ccc;
            width: 147px;
            display: none;
        }

        .video_menu {
            position: absolute;
            top: 60px;
            right: -1px;
            border-right: 1px solid #ccc;
            border-bottom: 1px solid #ccc;
            width: 98px;
            display: none;
        }

        .menu > div {
            cursor: pointer;
        }

        .local [type=file] {
            width: 49px;
            height: 60px;
            overflow: hidden;
            background: red;
            position: absolute;
            z-index: 5;
            opacity: 0;
        }

        .shuoshuodiv > div {
            border-bottom: 1px solid #ccc;
        }
    </style>
</head>
<body>


<div class="shuoshuodiv clearfix">
    <div class="shuoshuo_content fl"
         contenteditable="true"></div>
    <div class="shuoshuo_photo fl qqbg">
        <span></span>

        <div class="photo_menu clearfix menu">
            <div class="local fl qqbg">
                <input type="file" multiple/>
                <span></span>
                <p>本地</p>
            </div>
            <div class="ablum fl qqbg">
                <span></span>
                <p>相册</p>
            </div>
            <div class="screenshot fl qqbg">
                <span></span>
                <p>截图</p>
            </div>
        </div>
    </div>
    <div class="shuoshuo_audio_video fl qqbg">
        <span></span>

        <div class="video_menu clearfix menu">
            <div class="local fl qqbg">
                <span></span>
                <p>音乐</p>
            </div>
            <div class="ablum fl qqbg">
                <span></span>
                <p>视频</p>
            </div>

        </div>
    </div>
    <span>说点儿什么吧</span>
    <div id="shuoshuotip" style="display:none;margin-top:61px;width:700px;height:30px;background:orange;">
        说点什么吧
    </div>
</div>



<input type="button" value="发表" />

<script src="https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/js/lib/jquery-1.10.2_d88366fd.js"></script>
<script>
    $(".shuoshuodiv>span").click(
        function () {
            $(".shuoshuo_content").focus();
        }
    );

  //  $(".shuoshuo_content").append("<img src='http://qzonestyle.gtimg.cn/qzone/em/e113.gif?max_age=2592000' />");

    $(".shuoshuo_content").focus(
        function () {
            $(".shuoshuodiv>span").hide();
        }
    );

    $(".shuoshuo_content").blur(
        function () {
            if ($(this).text().trim().length == 0) {
                $(".shuoshuodiv>span").show();
            }
        }
    );

    var posY = 26;
    $(".qqbg").hover(
        function (e) {
            $(this).toggleClass("whitebg");
            $(this).find("span")
                .css("background-positionY", function (index, oldvalue) {
                    return parseInt(oldvalue) - posY + "px";
                });
            posY = -posY;

            $(this).find(".menu").toggle();
        }
    );

    $("input:file").change(
        function(){
            for(var i=0;i<this.files.length;i++) {
                var file = this.files[i];
                var fileReader = new FileReader();

                fileReader.readAsDataURL(file);//base64编码

                fileReader.onload = function () {
                    var $picdiv = $("<div style='width:280px;height:280px;float:left;margin:10px;position:relative'></div>");
                    $picdiv.css("background", "url(" + this.result + ") top center");
                    $picdiv.css("background-size", "cover");

                    var $closepic = $("<span style='width:24px;height:24px;position:absolute;top:0px;right:0px;display:block;" +
                        "background:red url(icenter-delay.32-yog170227172712.png) -158px -56px'></span>");

                    $closepic.css("cursor","pointer");
                    $closepic.click(
                        function(){
                            $(this).parent().remove();
                        }
                    );
                    $picdiv.append($closepic);
                    $("body").append($picdiv);
                }
            }
        }
    );

    $("input[value=发表]").click(
        function(){
            var shuoshuoCnt = $(".shuoshuo_content").text().trim();
            if(shuoshuoCnt.length==0){
                $("#shuoshuotip").show();
            }else{
                $("#shuoshuotip").hide();
                alert("发表成功！");
            }
        }
    );
</script>
</body>
</html>